Skip to content

feat(storage): add feature flag and models for appendable upload#5631

Open
vsharonlynn wants to merge 3 commits into
googleapis:mainfrom
vsharonlynn:feat/storage-appendable-upload
Open

feat(storage): add feature flag and models for appendable upload#5631
vsharonlynn wants to merge 3 commits into
googleapis:mainfrom
vsharonlynn:feat/storage-appendable-upload

Conversation

@vsharonlynn
Copy link
Copy Markdown
Contributor

Introduces the google_cloud_unstable_storage_appendable_upload feature flag to gate the upcoming GCS Appendable Upload functionality.

@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label May 8, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the initial infrastructure for appendable object uploads in the storage crate, gated by a new unstable configuration flag. The changes include updates to build triggers, lint configurations, and the addition of new data structures and modules. Feedback focuses on maintaining SDK consistency by using ergonomic model types instead of raw proto types, applying #[allow(dead_code)] to structs used only in mocks to prevent compiler warnings, and restricting module visibility to pub(crate) to align with existing internal modules.

Comment thread src/storage/src/model_ext.rs Outdated
Comment thread src/storage/src/model_ext.rs Outdated
Comment thread src/storage/src/storage.rs Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.96%. Comparing base (7d5ea01) to head (45c1729).
⚠️ Report is 21 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5631      +/-   ##
==========================================
- Coverage   97.96%   97.96%   -0.01%     
==========================================
  Files         221      221              
  Lines       51494    51536      +42     
==========================================
+ Hits        50447    50488      +41     
- Misses       1047     1048       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vsharonlynn vsharonlynn force-pushed the feat/storage-appendable-upload branch from 144a189 to 3deeb71 Compare May 8, 2026 06:12
Introduces the `google_cloud_unstable_storage_appendable_upload` feature
flag to gate the upcoming GCS Appendable Uploads functionality.
@vsharonlynn vsharonlynn force-pushed the feat/storage-appendable-upload branch 3 times, most recently from 30b9d9a to 93a0318 Compare May 11, 2026 06:28
@vsharonlynn vsharonlynn force-pushed the feat/storage-appendable-upload branch from 93a0318 to 790d68f Compare May 11, 2026 07:20
@vsharonlynn vsharonlynn marked this pull request as ready for review May 11, 2026 08:00
@vsharonlynn vsharonlynn requested review from a team as code owners May 11, 2026 08:00
Copy link
Copy Markdown
Contributor

@coryan coryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This points to a very low-level abstraction for appendable objects... you are defining public APIs that are direct mappings of the proto messages.

Ultimately, this is your call, but I think you want to raise the level of abstraction. Maybe think about what logical operations the application would want to do (I think "open an object for exclusive appends" and "append to an open object", and maybe "reopen an object for appends"). Implement those abstractions and hide the details from your customers.

FYI: @joshuatants

Comment thread .gcb/builds/triggers/main.tf Outdated
gcb_secret_name = "projects/${var.project}/secrets/github-github-oauthtoken-319d75/versions/latest"

unstable_flags = join(" ", [
"--cfg google_cloud_unstable_storage_appendable_upload",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use unstable_storage_bidi, it is not being used for anything else.

Comment thread src/storage/src/model_ext.rs Outdated
Comment on lines +317 to +322
pub enum AppendObjectFirstMessage {
/// Create a new appendable object.
Create(Box<crate::model::WriteObjectSpec>),
/// Take over an existing appendable object.
Takeover(AppendObjectSpec),
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like it should be two separate methods, not one method with an enum type.

@vsharonlynn
Copy link
Copy Markdown
Contributor Author

This points to a very low-level abstraction for appendable objects... you are defining public APIs that are direct mappings of the proto messages.

Ultimately, this is your call, but I think you want to raise the level of abstraction. Maybe think about what logical operations the application would want to do (I think "open an object for exclusive appends" and "append to an open object", and maybe "reopen an object for appends"). Implement those abstractions and hide the details from your customers.

FYI: @joshuatants

Thanks for your input Carlos! Sounds like a good idea. We're actively looking into this. I'm currently drafting the APIs to see how it looks. I'll get back soon.

@vsharonlynn vsharonlynn force-pushed the feat/storage-appendable-upload branch from 14655b3 to 2d91381 Compare May 13, 2026 09:31
Use existing `google_cloud_unstable_storage_bidi`, because currently
it's not being used for anything.

Separate the API into two, instead of one.
@vsharonlynn vsharonlynn force-pushed the feat/storage-appendable-upload branch from 2d91381 to 45c1729 Compare May 13, 2026 12:59
Copy link
Copy Markdown
Contributor

@coryan coryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider the nits and then merge.

#[non_exhaustive]
pub struct OpenAppendableObjectRequest {
/// The object attributes and pre-conditions for the open operation.
pub spec: Box<crate::model::WriteObjectSpec>,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unclear why you are using Box<T> here, but that is not enough reason to block the change.

#[cfg(google_cloud_unstable_storage_bidi)]
/// Represents the parameters of a request to open a new object for exclusive appends.
///
/// This type might be used in mocks of the `Storage` client.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
/// This type might be used in mocks of the `Storage` client.
/// Consumers of the `google-cloud-storage` crate rarely have a need to use this type directly, the most common exception is when mocking of the `Storage` client.

#[cfg(google_cloud_unstable_storage_bidi)]
/// Represents the parameters of a request to reopen an existing object for appends.
///
/// This type might be used in mocks of the `Storage` client.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same nit:

Suggested change
/// This type might be used in mocks of the `Storage` client.
/// Consumers of the `google-cloud-storage` crate rarely have a need to use this type directly, the most common exception is when mocking of the `Storage` client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the Cloud Storage API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants